<?php

Yii::import('application.modules.gallery.models.Gallery');

class NewsController extends Controller {

    /**
     * Lists all models.
     */
    public $layout = '//layouts/column1';

    public function init() {
        Yii::app()->theme = 'home';
    }

    public function actionView() {
        $criteria = new CDbCriteria(array(
            'order' => 'id DESC',
        ));
        if (!empty($model)) {
            $count = News::model()->count($criteria);
            $pages = new CPagination($count);
            $pages->pageSize = 12;
            $pages->applyLimit($criteria);
            $model = News::model()->findAll($criteria);
            $this->render('view', array('model' => $model, 'pages' => $pages));
        }
    }

}